import 'package:dio/dio.dart';
const leading="dish";
// 获取所有菜品
Future<Response<dynamic>> getAllDishes({required Dio dio}) async {
  Response<dynamic> response = await dio.post('/$leading/all');
  return response;
}

// 添加菜品
Future<Response<dynamic>> addDish({
  required Map<String, dynamic> dish,
  required Dio dio,
}) async {
  Response<dynamic> response = await dio.post('/$leading/add', data: dish);
  return response;
}

// 删除菜品 by 名称
Future<void> deleteDishByName({
  required String name,
  required Dio dio,
}) async {
  await dio.post('/$leading/delete', data: {'name': name});
}

// 更新菜品
Future<Response<dynamic>> updateDish({
  required Map<String, dynamic> dish,
  required Dio dio,
}) async {
  Response<dynamic> response = await dio.post('/$leading/update', data: dish);
  return response;
}
